package com.acmedcare.framework.exchange.center.endpoint;

import com.acmedcare.framework.exchange.center.entity.dto.Hdfs;
import com.github.pagehelper.PageHelper;
import java.util.Properties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@EnableConfigurationProperties(Hdfs.class)
public class ExchangeCenterServer {

  @Bean
  public PageHelper pageHelper() {
    PageHelper pageHelper = new PageHelper();
    Properties properties = new Properties();
    properties.setProperty("offsetAsPageNum", "true");
    properties.setProperty("dialect", "mysql");
    properties.setProperty("rowBoundsWithCount", "true");
    properties.setProperty("reasonable", "true");
    // 配置mysql数据库的方言
    pageHelper.setProperties(properties);
    return pageHelper;
  }

  /**
   * SQL执行效率插件
   */
 /* @Bean
  public PerformanceInterceptor performanceInterceptor() {
    return new PerformanceInterceptor();
  }*/
}
